# -*- coding: utf-8 -*-

rangetable = dict(
    # ascii = u"a-zA-Z0-9_",
    digit = u"\d",
    
    # U+AC00-D7AF 	Hangul Syllables 	ハングル音節文字
    hangul = u"\uAC00-\uD7AF",
    
    # U+30A0-30FF 	Katakana 	片仮名
    # U+3040-309F 	Hiragana 	平仮名
    #kana = u"\u3040-\u30FF",
    hiragana = u"\u3040-\u309F\u30FC",
    katakana = u"\u30A0-\u30FF",    
    
    # U+4E00-9FFF 	CJK Unified Ideographs 	CJK統合漢字
    # U+3400-4DBF 	CJK Unified Ideographs Extension A 	CJK統合漢字拡張A
    # U+F900-FAFF 	CJK Compatibility Ideographs 	CJK互換漢字
    ideo = u"\u4E00-\u9FFF\u3400-\u4DBF\uF900-\uFAFF",
    
    thai = u"\u0E00-\u0E7F", # U+0E00-0E7F Thai タイ文字
)

igns = (u"\s", u"\!-\&", u"\:-\@", u"\(-\/", u"\{-\~")
# igns = r"\W"

enc = 'utf-8'
STOP_WORD = []


if __name__=="__main__":
    def show(x):
        print x,unicodedata.name(x),ord(x)
    import re,unicodedata

    print 1
    print 2
    print unicodedata.name(u"　")
    print unicodedata.name(unicodedata.normalize("NFKC",u"　"))
    p = re.compile(u"[^u\0000-u\002Fu\005B-u\005Du\007B-u\00FF]+", re.UNICODE)
    ign = u"".join(igns)
    p = re.compile(u"[^%s]+"% ign , re.UNICODE)
    print u" ".join(p.findall(u'ab cd=eあee'))
    print 1
#    print p.findall(u"accabeeg")
#    print repr(u"/")
    
#    show(u"+")
    for x in range(256):
        try:
            name = unicodedata.name(unichr(x))
        except:
            name = "ERROR"
        print x,"%X"%x,chr(x),name
